<?php
    /**
     * SEPARATE FILE FOR POTION DRINKING
     * THIS IS USED A FEW OTHER PLACES, BEFORE SEARCHING
     * WHILE FIGHTING
     * */
    if($c['potions'] == 0)
    {
        echo '<p><i>';
        lwriteln('`3You dig through your pouches and find nothing, and realize you should probably go back and get some');
        echo '</p></i>';
    }
    else
    {
        /* deduct a potion  and update record */
        $c['potions'] --;
        update($_SESSION['id'],'potions', $c['potions']);                        
        lwriteln('`3You takea quick swig of the sweet tasting potion...');
                        
        /* is it a wasted effort? */
        if($c['hp'] == $c['hpMax'])
        {
            lwriteln('`3 and realize, what a WASTE, as you have no injuries!!!');
        }
        else
        {
            /* wounds healed */                            
            $c['hp'] = $c['hpMax'];
            update($_SESSION['id'], 'hp', $c['hp']);
            lwriteln('`3 and admire at the speed your wounds healed leaving you with a refresh feeling!');                        
        }
                        
        /* potion buying status after usage = fun gossip */
        if($c['potions'] == 0)
            lwriteln('`3And that was your last one!!');
        if($c['gold'] > 0)
            lwriteln('`3Maybe you should head back to town and check to see if you can afford more before your next enounter');
        else
            lwriteln('`3And that is bad, as you have no gold to buy more!! Good luck on your next enoounter!!');
    }// has potions or no?
?>